﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RoomAvailability.aspx.cs" Inherits="DelonixRegiaHotel.RoomAvailability" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        .auto-style1 {
            width: 1270px;
            height: 702px;
        }
        .auto-style3 {
            height: 60px;
        }
        .auto-style4 {
            height: 52px;
        }
        .auto-style6 {
            height: 280px;
            margin-left: 40px;
        }
        .auto-style7 {
            width: 1270px;
        }
        .auto-style8 {
            height: 52px;
            width: 135px;
        }
        </style>
</head>
<body style='background: #000'>
    <form id="form1" runat="server">
    <div>
    
        <table cellspacing="0" class="auto-style1" style="background-image:url(Images/TemplateForHome.png); background-size: cover;">
            <tr>
            <td class="auto-style3" colspan="9">
                <asp:ImageButton ID="btnLogo" runat="server" CausesValidation="False" ImageUrl="~/Images/Delonix Regia Logo.png" OnClick="btnLogo_Click" />
            </td>
            <td class="auto-style3">
                <asp:ImageButton ID="btnLogout" runat="server" CausesValidation="False" ImageUrl="~/Images/Logout.png" OnClick="btnLogout_Click" />
            </td>
        </tr>
        <tr>
            <td class="auto-style4">&nbsp;&nbsp;&nbsp;</td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnAdmin" runat="server" CausesValidation="False" ImageUrl="~/Images/Admin.png" OnClick="btnAdmin_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnCheckIn" runat="server" CausesValidation="False" ImageUrl="~/Images/Check-In.png" OnClick="btnCheckIn_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnCheckOut" runat="server" CausesValidation="False" ImageUrl="~/Images/Check-Out.png" OnClick="btnCheckOut_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnQuery" runat="server" CausesValidation="False" ImageUrl="~/Images/Query.png" OnClick="btnQuery_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnBooking" runat="server" CausesValidation="False" ImageUrl="~/Images/Booking.png" OnClick="btnBooking_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnRates" runat="server" CausesValidation="False" ImageUrl="~/Images/Rates.png" OnClick="btnRates_Click" />
            </td>
            <td class="auto-style4">
                <asp:ImageButton ID="btnStaff" runat="server" CausesValidation="False" ImageUrl="~/Images/Staff.png" OnClick="btnStaff_Click" />
            </td>
            <td class="auto-style8">
                <asp:ImageButton ID="btnReport" runat="server" CausesValidation="False" ImageUrl="~/Images/Report.png" OnClick="btnReport_Click" />
            </td>
            <td class="auto-style4"></td>
        </tr>
        <tr>
            <td class="auto-style6" colspan="10">
&nbsp;<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="room_num" DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display." ForeColor="Yellow" Width="740px" Font-Size="Small">
                    <Columns>
                        <asp:CommandField ShowEditButton="True" ShowSelectButton="True" />
                        <asp:BoundField DataField="room_num" HeaderText="room_num" ReadOnly="True" SortExpression="room_num" />
                        <asp:TemplateField HeaderText="room_type" SortExpression="room_type">
                            <EditItemTemplate>
                                <asp:DropDownList ID="DropDownList3" runat="server" SelectedValue='<%# Bind("room_type") %>'>
                                    <asp:ListItem>Standard</asp:ListItem>
                                    <asp:ListItem>Deluxe</asp:ListItem>
                                    <asp:ListItem>Executive</asp:ListItem>
                                    <asp:ListItem>Superior</asp:ListItem>
                                    <asp:ListItem>Suite</asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("room_type") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="room_status" SortExpression="room_status">
                            <EditItemTemplate>
                                <asp:DropDownList ID="DropDownList1" runat="server" SelectedValue='<%# Bind("room_status") %>'>
                                    <asp:ListItem>Available</asp:ListItem>
                                    <asp:ListItem>Unavailable</asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("room_status") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="smoking_room" SortExpression="smoking_room">
                            <EditItemTemplate>
                                <asp:DropDownList ID="DropDownList2" runat="server" SelectedValue='<%# Bind("smoking_room") %>'>
                                    <asp:ListItem>Smoking Room</asp:ListItem>
                                    <asp:ListItem>Non-Smoking Room</asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("smoking_room") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <SelectedRowStyle ForeColor="Red" BorderColor="Red" BorderWidth="2px" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:hoteldbConnectionString %>" DeleteCommand="DELETE FROM [HotelRoom] WHERE [room_num] = @room_num" InsertCommand="INSERT INTO [HotelRoom] ([room_num], [room_type], [room_status], [smoking_room]) VALUES (@room_num, @room_type, @room_status, @smoking_room)" ProviderName="<%$ ConnectionStrings:hoteldbConnectionString.ProviderName %>" SelectCommand="SELECT [room_num], [room_type], [room_status], [smoking_room] FROM [HotelRoom]" UpdateCommand="UPDATE [HotelRoom] SET [room_type] = @room_type, [room_status] = @room_status, [smoking_room] = @smoking_room WHERE [room_num] = @room_num">
                    <DeleteParameters>
                        <asp:Parameter Name="room_num" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="room_num" Type="String" />
                        <asp:Parameter Name="room_type" Type="String" />
                        <asp:Parameter Name="room_status" Type="String" />
                        <asp:Parameter Name="smoking_room" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="room_type" Type="String" />
                        <asp:Parameter Name="room_status" Type="String" />
                        <asp:Parameter Name="smoking_room" Type="String" />
                        <asp:Parameter Name="room_num" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <br />
                <asp:Label ID="Label1" runat="server" ForeColor="Yellow" Text="Room No.:"></asp:Label>
&nbsp;<asp:TextBox ID="tbxRoomNum" runat="server" BackColor="#3399FF" BorderColor="#66FF33" BorderWidth="3px"></asp:TextBox>
&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbxRoomNum" ErrorMessage="Please enter room number" ForeColor="Red"></asp:RequiredFieldValidator>
                <br />
                <br />
                <asp:Label ID="Label2" runat="server" ForeColor="Yellow" Text="Room Type:"></asp:Label>
                <asp:DropDownList ID="ddlRoomtype" runat="server" BackColor="#3399FF">
                    <asp:ListItem>Standard</asp:ListItem>
                    <asp:ListItem>Deluxe</asp:ListItem>
                    <asp:ListItem>Executive</asp:ListItem>
                    <asp:ListItem>Superior</asp:ListItem>
                    <asp:ListItem>Suite</asp:ListItem>
                </asp:DropDownList>
                &nbsp;
                <asp:DropDownList ID="ddlSmokingroom" runat="server" BackColor="#3399FF">
                    <asp:ListItem>Smoking Room</asp:ListItem>
                    <asp:ListItem>Non-Smoking Room</asp:ListItem>
                </asp:DropDownList>
                <br />
&nbsp;&nbsp;
                <br />
                <asp:Button ID="btnSubmit" runat="server" BackColor="Black" BorderColor="#FF3300" BorderWidth="3px" ForeColor="#FF3300" OnClick="btnSubmit_Click" Text="Submit" />
                <br />
                <br />
            </td>
        </tr>
        <tr>
            <td class="auto-style7" colspan="10">&nbsp;</td>
        </tr>
        </table>
    
    </div>
    </form>
</body>
</html>